\documentclass{article}
\usepackage{geometry}
\geometry{margin=1.5cm, vmargin={0pt,1cm}}
\setlength{\topmargin}{-1cm}
\setlength{\paperheight}{29.7cm}
\setlength{\textheight}{25.3cm}

% useful packages.
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{layout}
\usepackage{ctex}
\usepackage{listings}

% some common command
\newcommand{\dif}{\mathrm{d}}
\newcommand{\avg}[1]{\left\langle #1 \right\rangle}
\newcommand{\difFrac}[2]{\frac{\dif #1}{\dif #2}}
\newcommand{\pdfFrac}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\OFL}{\mathrm{OFL}}
\newcommand{\UFL}{\mathrm{UFL}}
\newcommand{\fl}{\mathrm{fl}}
\newcommand{\op}{\odot}
\newcommand{\Eabs}{E_{\mathrm{abs}}}
\newcommand{\Erel}{E_{\mathrm{rel}}}

\usepackage{xcolor}
\usepackage{fontspec} 
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{comment}{rgb}{0.56,0.64,0.68}


\begin{document}
\title{Project \#1}
\pagestyle{fancy}
\lhead{Name Li HuiTeng 3180102114}
\chead{ High Order Numerical Method}
\rhead{Date 21.10.17}

\section*{实验结果展示}
本次实验实现了可同时适用于二维,三维情况的VectorFunction类。
用户可以使用它的内部成员函数setFAB来进行CellAverage或CellCenter赋值。
并且，用户可以使用它的内部成员函数setLaplacian来进行四阶精度Laplacian算子赋值。
本次实验也通过实现二，三维下具体的CellAverageFunction，通过与真解比较，验证了Laplacian算子的四阶精度与收敛性，
并测算了在不同大小Box上所需要的CPU计算时间。

下面是编译运行testFunction2D.cpp与testFunction3
.cpp后的结果。
\begin{lstlisting}
	Running testFunction2D for configuration 2d.Linux.64.g++.gfortran.DEBUG ...
	Served for 2D situation. 
	1. CPU Time Test for Setting Values on Boxes
	For sizes 128*128, CPU time is 0.112625 s.
	For sizes 256*256, CPU time is 0.433984 s.
	For sizes 512*512, CPU time is 1.73884 s.
	For sizes 1024*1024, CPU time is 7.01043 s.
	For sizes 2048*2048, CPU time is 28.2799 s.
	 
	2. CPU Time Test for 4th Discrete Laplacian: 
	For sizes 128*128, CPU time is 0.130558 s. 
	For sizes 256*256, CPU time is 0.527875 s. 
	For sizes 512*512, CPU time is 2.15602 s. 
	For sizes 1024*1024, CPU time is 8.4214 s. 
	For sizes 2048*2048, CPU time is 33.383 s. 
	 
	3. Grid Refinement Test for 4th Discrete Laplacian:
	For velocity (u,v) and pressure p, we have
	u:
	sizes 128*128 , L1 norm err : 0.00779184
	sizes 256*256 , L1 norm err : 0.000503865
	sizes 512*512 , L1 norm err : 3.19614e-05
	sizes 1024*1024 , L1 norm err : 2.01119e-06
	sizes 2048*2048 , L1 norm err : 1.26169e-07
	convergence rate is: 
	3.95085
	3.97864
	3.99021
	3.99462
	v:
	sizes 128*128 , L1 norm err : 0.00779184
	sizes 256*256 , L1 norm err : 0.000503865
	sizes 512*512 , L1 norm err : 3.19614e-05
	sizes 1024*1024 , L1 norm err : 2.01119e-06
	sizes 2048*2048 , L1 norm err : 1.26169e-07
	convergence rate is: 
	3.95085
	3.97864
	3.99021
	3.99462
	p:
	sizes 128*128 , L1 norm err : 0.117814
	sizes 256*256 , L1 norm err : 0.00777405
	sizes 512*512 , L1 norm err : 0.000497528
	sizes 1024*1024 , L1 norm err : 3.14338e-05
	sizes 2048*2048 , L1 norm err : 1.97473e-06
	convergence rate is: 
	3.9217
	3.96582
	3.98439
	3.99259
	peak memory usage: 201326896 bytes (192 Mb)
	... testFunction2D finished with status 0	
\end{lstlisting}
在离散Laplacian算子部分的数值实验中，我们可以发现，每当cell数量变为之前的4倍或8倍时，CPU运行时间也会相应变为先前4倍或8倍。同时，速度与压强p的收敛阶也均近似为4。
当然，由于实验中使用的笔记本算力有限，3维情况的网格数相对较少，故收敛阶相比2维偏差的更大一些。
\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
